/*
basic setting of window for index.html
 */

var gui=require('nw.gui');
var win=gui.Window.get();

$(document).ready(function(){
    // set window initial position and size
    var screen_width=window.screen.availWidth;
    var screen_height=window.screen.availHeight;

    win.x=Math.round(screen_width*0.75);
    win.y=Math.round(screen_height*0.025);

    win.width=Math.round(screen_width*0.205);
    win.height=Math.round(screen_height*0.941);
    $('body').css('height',Math.round(screen_height*0.941));

    //响应 f12开发者工具，以及f5 页面刷新
    $(document).on('keydown',function(event){
        var keycode=event.keyCode;
        //f12
        if(keycode === 123){
            win.showDevTools();
        }
        //f5
        if(keycode === 116){
            win.reload();
        }
    });
});
